#pragma once
#include <Windows.h>
#include <string>
#include <vector>
#define ArrayEnd std::wstring(L"")

class ShareMemory_StringArray
{
public:
	int insert(const std::wstring& str);
	int getStringVector(std::vector<std::wstring>& strVec);
	void clear();

public :
	static ShareMemory_StringArray* Create(HANDLE& hMap,const std::wstring& name);
	static ShareMemory_StringArray* Open(HANDLE& hMap, const std::wstring& name);
	static void Close(ShareMemory_StringArray* obj, HANDLE hMap);

private:
	static const int bufferSize = 2048 * sizeof(wchar_t) * 100;

private:
	ShareMemory_StringArray(LPWSTR buff) : m_buffer(buff) {};
	~ShareMemory_StringArray() { ::UnmapViewOfFile(reinterpret_cast<void*>(m_buffer)); }

private:
	LPWSTR m_buffer;
};
